Re: [SQL] ' escape - Mailing list pgsql-sql

From Herouth Maoz
Subject Re: [SQL] ' escape
Date
Msg-id l03110700b292a3705f91@[147.233.159.109]
Whole thread Raw
In response to Re: [SQL] ' escape  (jwieck@debis.com (Jan Wieck))
List pgsql-sql
At 11:27 +0200 on 8/12/98, Jan Wieck wrote:


>
>     But
>
>     create table ... default 'x\'\'y');
>
>     does. Whenever something around quotes doesn't work, I first
>     try to double them.

Nevertheless, it is a bug. You should double your quotes when they are
inside other quotes. When surrounded by doubled quotes, you have to
quadruple them. Or to escape them and escape the escapes. The following
also works:

testing=> CREATE TABLE test1
testing-> (
testing->    id int,
testing->    name varchar(128) default 'something with \\'' in it'
testing-> );

But it shouldn't, because it is only surrounded by single unescaped quotes.
If this string is used in any other context, it will have a single slash
and a single quote in it. Something is amiss.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



pgsql-sql by date:

Previous
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Re: [SQL] ' escape
Next
From: Petter Reinholdtsen
Date:
Subject: Oracle SQL 'comment on ...'